package com.hyc.util;

import com.google.common.collect.Lists;
import org.msgpack.MessagePack;
import org.msgpack.template.Templates;

import java.io.IOException;
import java.util.List;

public class MsgPackDemo {

    public static void main(String[] args) throws IOException {
        List<Integer> src = Lists.newArrayList(1, 2, 3);
        MessagePack pack = new MessagePack();
        byte[] raw = pack.write(src);
        List<Integer> dest = pack.read(raw, Templates.tList(Templates.TInteger));
        dest.stream().forEach(System.out::println);
    }
}
